package com.example.day19_7_19_1.presenter;

import com.example.day19_7_19_1.base.BasePresenter;
import com.example.day19_7_19_1.bean.ItemBean;
import com.example.day19_7_19_1.bean.TabBean;
import com.example.day19_7_19_1.model.IModel;
import com.example.day19_7_19_1.util.LogUtil;
import com.example.day19_7_19_1.util.ResultBack;
import com.example.day19_7_19_1.view.IView;

public class IPresenter extends BasePresenter<IView> {

    private IModel iModel;

    @Override
    protected void initModel() {
        iModel = new IModel();
    }

    @Override
    public void getData(int id) {
        iModel.getData(id,new ResultBack<ItemBean>() {
            @Override
            public void succeed(ItemBean itemBean) {
                iView.setData(itemBean);
            }

            @Override
            public void failed(String error) {

            }
        });
    }

    @Override
    public void getTabData(){
        iModel.getTabData(new ResultBack<TabBean>() {
            @Override
            public void succeed(TabBean tabBean) {
                iView.setTab(tabBean);
            }

            @Override
            public void failed(String error) {

            }
        });
    }
}
